#!/usr/bin/python
# -*- coding: utf-8 -*-

class person:
    """
        The class is for modelling a person on irc channel
    """
    
    def __init__(self, nick, messages, ae = list()):
        """
            The arguments
            nick,     the name of person on channel
            ae,       list including the other nicks person uses on channel
            messages, dict, which includes nicks and number of messages of other persons
        """
        
        self.nick     = nick
        self.messages = messages
        self.ae       = ae

    def add(self, other):
        
        for i in self.messages:
            if i in other.messages:
                self.messages[i] += other.messages[i]
                #del toinen.messages[i]
                
        for i in other.messages:
            self.messages[i] = other.messages[i]
            #del toinen.messages[i]
    
    def string(self, a):
        print self.messages
    